Avoid a dereference-before-null-check
authorMatthias Clasen <mclasen@redhat.com>
Wed, 15 Jun 2011 01:50:16 +0000 (21:50 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 15 Jun 2011 01:50:16 +0000 (21:50 -0400)
gtk/gtktoolbar.c

index 2515d3cf927b3088c6285e4a1fd6242cf807b55c..f6549194a7e241c649270b4cc0a61169047892d8 100644 (file)
@@ -3669,7 +3669,6 @@ _gtk_toolbar_paint_space_line (GtkWidget           *widget,
                               GtkToolbar          *toolbar,
                                cairo_t             *cr)
 {
-  GtkToolbarPrivate *priv = toolbar->priv;
   GtkOrientation orientation;
   GtkStyleContext *context;
   GtkStateFlags state;
@@ -3680,7 +3679,7 @@ _gtk_toolbar_paint_space_line (GtkWidget           *widget,
 
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  orientation = toolbar ? priv->orientation : GTK_ORIENTATION_HORIZONTAL;
+  orientation = toolbar ? toolbar->priv->orientation : GTK_ORIENTATION_HORIZONTAL;
 
   context = gtk_widget_get_style_context (widget);
   state = gtk_widget_get_state_flags (widget);